package com.oms.app.user.service.impl;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import net.sf.json.JSONObject;

import com.oms.app.sequence.service.impl.SequenceManager;
import com.oms.app.user.dao.IGroupDAO;
import com.oms.app.user.dao.IUserDAO;
import com.oms.app.user.model.Group;
import com.oms.app.user.model.User;
import com.oms.app.user.service.IGroupService;
import com.oms.app.user.service.IUserService;
import com.oms.core.service.impl.GeneralService;
import com.oms.util.DataDeal;
import com.oms.util.DateUtil;

/**
 * controller
 * @author wtj
 * @date Sep 10, 2012  10:25:25 PM
 */


public class GroupServiceImpl extends GeneralService<Object, String> implements IGroupService {

	@Override
	public int delete(String primaryKey) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Object get(String primaryKey) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public List getGroupList(HttpServletRequest request) {
		return ((IGroupDAO) dao).getGroupList(request);
	}

	@Override
	public boolean groupAddRole(Map map) {
		return ((IGroupDAO) dao).groupAddRole(map);
	}

	@Override
	public boolean groupAddUser(Map map) {
		return ((IGroupDAO) dao).groupAddUser(map);
	}

	@Override
	public boolean saveOrUpdateGroup(Group groupForm) {
		groupForm.setId(new Integer(SequenceManager.nextID("tmodule")));
		System.out.println("2012年9月13日22:29:04 ："+JSONObject.fromObject(groupForm).toString());
		return ((IGroupDAO) dao).saveOrUpdateGroup(groupForm);
	}

	@Override
	public boolean deleteGroup(String PK) {
		return ((IGroupDAO) dao).deleteGroup(PK);
	}

	@Override
	public boolean isGroupRole(Map map) {
		return ((IGroupDAO) dao).isGroupRole(map);
	}


}